package day09;

/**
 * 银行卡
 * @author: yyfei  
 * @email:  yyfei123@qq.com
 */
public class Acount {
	/**
	 * 卡号
	 */
	private String cardId;
	/**
	 * 余额
	 */
	private double balance;
	
	public Acount() {
		
	}
	
	public Acount(String cardId,double balance) {
		this.cardId=cardId;
		this.balance=balance;
	}
	
	
	public String getCardId() {
		return cardId;
	}

	public void setCardId(String cardId) {
		this.cardId = cardId;
	}

	public double getBalance() {
		return balance;
	}

	public void setBalance(double balance) {
		this.balance = balance;
	}

	/**
	 * 存钱
	 */
	
	public void saveMoney(double money) {
		balance+=money;
	}
	
	
	/**
	 * 取钱
	 */
	public void getMoney(double money) {
		if (money>balance) {
			System.out.println("余额不足");
		} else {
			balance-=money;
		}
	}
	
	
}
